<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加载全球地形</title>
    <script type="text/javascript"
        src="https://cesium.com/downloads/cesiumjs/releases/1.112/Build/Cesium/Cesium.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/cesium/1.109.0/Widgets/widgets.css">
    <style>
        html,
        body,
        #cesiumContainer {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        .btn-group {
            position: absolute;
            z-index: 99999;
            top: 20px;
            left: 20px;
        }
    </style>
</head>

<body>
    <div id="cesiumContainer">
        <button type="button" class="btn-group" onclick="cesiumlabTerrain()">加载全球地形</button>
    </div>
    <script>
        Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxYmM3MjllNS04YTg2LTQ3ZWMtOWFmNi1mN2JiZjk1NWI3MzAiLCJpZCI6MzgzOTgsImlhdCI6MTY3NzI4NjYwNn0.ZGHM2hyly98PYjpQ_krciBisOsevj9VEG_0dif7gT70'
        const viewer = new Cesium.Viewer('cesiumContainer', {});
        async function cesiumlabTerrain() {
            var terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl(
                'https://terrain.giiiis.com/terrain', {
                requestWaterMask: true,

            });
            viewer.terrainProvider = terrainProvider;
        }

    </script>
</body>

</html>